import Mock from "mockjs";
const Random = Mock.Random;

// 浏览数据
export const overview = Mock.mock({
  code: 200,
  data: {
    file: Random.float(60, 100, 2, 2) + "M",
    "articles|0-50": 0,
    "gallery|0-50": 0,
    "diary|0-50": 0,
    "projdect|0-50": 0,
    "rescource|0-50": 0,
  },
});

// 访问量
export const visit = Mock.mock({
  "data|30": [
    {
      // 时间
      date: "@datetime('MM-dd')",
      "count|10-100": 12,
    },
  ],
});

// 数据监测
export const survey = Mock.mock({
  data: {
    device: [
      {
        key: "mobile",
        name: "手机端",
        "value|30-120": 30,
      },
      {
        key: "pc",
        name: "电脑端",
        "value|30-120": 40,
      },
      {
        key: "others",
        name: "其他",
        "value|30-120": 50,
      },
    ],
    website: [
      {
        key: "home",
        name: "首页",
        "value|30-120": 30,
      },
      {
        key: "project",
        name: "项目",
        "value|30-120": 40,
      },
      {
        key: "photo",
        name: "照片",
        "value|30-120": 50,
      },
      {
        key: "article",
        name: "文章",
        "value|30-120": 60,
      },
      {
        key: "file",
        name: "本地文件",
        "value|30-120": 70,
      },
    ],
  },
});

// 评论
export const comment = Mock.mock({
  data: {
    count: 100,
    "list|50": [
      {
        "id|+1": 0,
        article: {
          "id|+1": 2,
          title: "@ctitle(5,15)",
        },
        user: {
          "id|+1": 3,
          name: "@cname()",
          imgurl:
            "https://www.huohuo90.com:3003/user/6353b034dd4b583975e77fbe.png",
        },
        comment: "@cparagraph(1,4)",
        moment: "@datetime()",
        "complaint|0-12": 0,
      },
    ],
  },
});